package co.yixiang.modules.system.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
* @author zf
* @date 2021-09-09
*/
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("cs_car")
public class CsCar implements Serializable {

    @TableId
    private Integer id;


    private String openId;


    /** 手机号 */
    private String phone;


    /** 车总价 */
    private String money;


    /** 企业名称 */
    private String company;


    /** 购买时间 */
    private String payTime;


    /** 创建时间 */
    @TableField(fill= FieldFill.INSERT)
    private LocalDateTime createTime;


    public void copy(CsCar source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
